UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r2axe9nYpFjd/BjjDvfOY6VFxDxFmUyDzM75gxqid7c=' 
WHERE 
  key_id = '6bbeef79c177d88e6fac5efc5fd89aecd233de88381e813370acd2a69797e68e' 
  AND (
    token = 'r2axe9nYpFjd/BjjDvfOY6VFxDxFmUyDzM75gxqid7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022