UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n93w+KQmKHaJHiZF7iw0933w/sZjU8nI5Fk9VvUk/so=' 
WHERE 
  key_id = '6ad0216a4c6d92303d575c64cda9e6f973551cc28d67d53c792543cf7c8e0812' 
  AND (
    token = 'n93w+KQmKHaJHiZF7iw0933w/sZjU8nI5Fk9VvUk/so=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034