UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x4ETbN8VkgzQNjOyEjfLQ9hR+sB/e6biEgTzbEs8CV8=' 
WHERE 
  key_id = '6428a8ed8f0203ac64fd59237a099522c75cf0b15c06ffd139bbaded4664fec3' 
  AND (
    token = 'x4ETbN8VkgzQNjOyEjfLQ9hR+sB/e6biEgTzbEs8CV8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031