UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QS6WTmXKrfICZBgoAwj0h8nRVFrnOYeKXiTMqKKpS/w='
WHERE
key_id = '4a47af26e620e9dc2f7dd68db98a50b84ecbfebb8721d1411cffa3bbc0ca8bde'
AND (
token = 'QS6WTmXKrfICZBgoAwj0h8nRVFrnOYeKXiTMqKKpS/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)