UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fm+CJClNDEfqBiCBW7JVJqZXbWGNVxEgG8uSM4OtlYM='
WHERE
key_id = 'b2297e588ede95e5f4077b3a2e4543940ce0f00dda3e3c2a7574580a8c028a9a'
AND (
token = 'fm+CJClNDEfqBiCBW7JVJqZXbWGNVxEgG8uSM4OtlYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)