UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zEGK4d3jBhKWHWzvSNdTpem4W+guPC3VHsfoXdJ92UQ=' 
WHERE 
  key_id = 'eed76b167a2a8a81c7ef8c3bd93ddb8a712b8a046f9d3123223fbb5acbb313f4' 
  AND (
    token = 'zEGK4d3jBhKWHWzvSNdTpem4W+guPC3VHsfoXdJ92UQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022