UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jTXpsiVh8/E9ePJzu0lxN/oBaXtWu+t8jU1MQbjm3nQ=' 
WHERE 
  key_id = '6cc62bc58aeced03bfbbfbe4ae9813aa8d4affa826b3e85a2b6dae80629bcc07' 
  AND (
    token = 'jTXpsiVh8/E9ePJzu0lxN/oBaXtWu+t8jU1MQbjm3nQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040