UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uratnr3ogTsVq1ymvf3t9uNjGwczwqtaUGhKAONS91o=' 
WHERE 
  key_id = 'fcd067b3c35b98b657ca0224c25f3bdb669318f311aa2924609dae4ecc52bea2' 
  AND (
    token = 'Uratnr3ogTsVq1ymvf3t9uNjGwczwqtaUGhKAONS91o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036