UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RNR+6gBVCWmm73jnr/LMw4vLTNPhNRM+5jjHv26vKas=' 
WHERE 
  key_id = 'a940bbbebefde9c9809af679e9b7c8734d1ca274a96f0bd8b03b9cd4e6b081d4' 
  AND (
    token = 'RNR+6gBVCWmm73jnr/LMw4vLTNPhNRM+5jjHv26vKas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033