UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v+zu3Q7pZf8d9FMR4/Hp6ZASFeDwSRJIkdVQuFWMPlA=' 
WHERE 
  key_id = '090682ff09842eeaacd17261f4ba06a1e2fa210a0b0cc7fa656fa1a34bdb4d36' 
  AND (
    token = 'v+zu3Q7pZf8d9FMR4/Hp6ZASFeDwSRJIkdVQuFWMPlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040