UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+XspkD+cT2JqzDUXOM0q5vIhYofq7XYRHNVIFEEgJ2Q=' 
WHERE 
  key_id = '14672ea1594f1b336a31a42c2c4c70070c8ca8fe01709d35d95f095b2bbd1da1' 
  AND (
    token = '+XspkD+cT2JqzDUXOM0q5vIhYofq7XYRHNVIFEEgJ2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034