UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'twCFPp1vJIwXUPtx5t5a9RS6AMnOTLAhAvCi0QvH/Ck=' 
WHERE 
  key_id = 'c4db6700c385332cae30c42f164aa9c524f1b26840ee4b185247db6964ab8073' 
  AND (
    token = 'twCFPp1vJIwXUPtx5t5a9RS6AMnOTLAhAvCi0QvH/Ck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027