UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1iDMrt7rHL/S8BJIbw9qGAJ17/TrothQU0YRlKw5GZc=' 
WHERE 
  key_id = '7daa26799363e153a79e7a65f268f2523943568b4bc05f795c259552f277a77a' 
  AND (
    token = '1iDMrt7rHL/S8BJIbw9qGAJ17/TrothQU0YRlKw5GZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033