UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y6pCB1pCkZpKvizvnPI/nqJjvPnL9p2nAZg7TS53XhI=' 
WHERE 
  key_id = '3a0b0138d5118db066245d0f14c675f1bdfe75ae6af0d400aa20dd7914968e0a' 
  AND (
    token = 'Y6pCB1pCkZpKvizvnPI/nqJjvPnL9p2nAZg7TS53XhI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027