UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l/XfVAODOvDd7sbQhI2pOKKv0T2rzR6f4O0OLIYM9uc=' 
WHERE 
  key_id = '664b4ace6c79fcbf11930a0b4cc3ede4a8633e9bb76a0e8547d9b6b809fa2428' 
  AND (
    token = 'l/XfVAODOvDd7sbQhI2pOKKv0T2rzR6f4O0OLIYM9uc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028