UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+7iqFquU4cB1BQv4jlxWGI4aVLdLLyNTNqiwOSos2b4=' 
WHERE 
  key_id = '77383fa75dbc14ab4bf7640466409680f7fe825abec815b9095906c9dee79f86' 
  AND (
    token = '+7iqFquU4cB1BQv4jlxWGI4aVLdLLyNTNqiwOSos2b4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033