UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k1RdKomfxFmkshRXxa5K8xbeQbhlQCP4XGUn7DI1/08='
WHERE
key_id = 'c08f498db6f4938ea3af9247af5e5d4ea3484390d3ffab1323a60fa1dcaf5dce'
AND (
token = 'k1RdKomfxFmkshRXxa5K8xbeQbhlQCP4XGUn7DI1/08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)