UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J7EMIMHHlA0OnKjGfg7TqdqWuMOTTWcTCymfzJTRAWc=' 
WHERE 
  key_id = '32459de5365342d435fe2848bc80699b5df593836c063a45c8d2037dc5256ff2' 
  AND (
    token = 'J7EMIMHHlA0OnKjGfg7TqdqWuMOTTWcTCymfzJTRAWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018