UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'emeGTj3fF1a+af/Eerv2jr37nciPwVWblClJCG9In00='
WHERE
key_id = 'f11d00df5583865fc287384d9f000d37999f68efe1c2f3dc747bd44a12187201'
AND (
token = 'emeGTj3fF1a+af/Eerv2jr37nciPwVWblClJCG9In00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)