UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xQPZnb+XMbTXHWAYqE6dkcNkuTyT5xOyi8UD76CTqxA='
WHERE
key_id = 'b94058c3a292cd49888bcc337a1f233ad4d1974de661fd6e43bc2f0af363770c'
AND (
token = 'xQPZnb+XMbTXHWAYqE6dkcNkuTyT5xOyi8UD76CTqxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)