UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UJhx7zKb4mBexApXDrlP5qIc/0wEBYyF6sB5bpEWzlg=' 
WHERE 
  key_id = '0651c256166126c01dbfe98012fd57b510b2c7a25c12585dd677db574999f894' 
  AND (
    token = 'UJhx7zKb4mBexApXDrlP5qIc/0wEBYyF6sB5bpEWzlg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023