UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjj0LckmGmwvI1BKlHvwkyywdVo7gJgVWtpyDEqH/GE=' 
WHERE 
  key_id = 'f2af4af793c964ff688730e20f9373c652d22f5dc4ab0d12db48df3f707982dc' 
  AND (
    token = 'cjj0LckmGmwvI1BKlHvwkyywdVo7gJgVWtpyDEqH/GE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023