UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vOWI2E6P7pnrdf2V/neA0ihZPhmTyWFfv6HZmPH+PY8='
WHERE
key_id = '6edfea718e4620011ad16464b29f47ae19530dbca674bc31ea38f7a2feb2e8b7'
AND (
token = 'vOWI2E6P7pnrdf2V/neA0ihZPhmTyWFfv6HZmPH+PY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)