UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3EFzbdCr1AcjiV1RXu3Dok773DzhnGeRl9k73ySrvww=' 
WHERE 
  key_id = '5c26e9e7e8db5345416fa3e4c7f64d45ac93583e438ce5f2fe00554d8772fbe1' 
  AND (
    token = '3EFzbdCr1AcjiV1RXu3Dok773DzhnGeRl9k73ySrvww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026