UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fj5QKg/Gvx8Nqw/HuoPvjDnKemudH7JVyi2IugRDyuI=' 
WHERE 
  key_id = 'd8d457d30c95b963e8cb0c3b6c186ca4d44e131863e7ea5cd0feba95fbcc0b08' 
  AND (
    token = 'fj5QKg/Gvx8Nqw/HuoPvjDnKemudH7JVyi2IugRDyuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020