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