UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ns+XYYLr4BF7n4RoWUtCGMbdW4cz2lANzH9F8O1o8M=' 
WHERE 
  key_id = 'f86f35796ce86811140aa021b9d524ba2a25e35b028032256683390c8083ad92' 
  AND (
    token = '4ns+XYYLr4BF7n4RoWUtCGMbdW4cz2lANzH9F8O1o8M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033