UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QEs70zL5Onxh0nMuGU7FysP55feRh+6Hdq8H80v2ydI='
WHERE
key_id = '179f500785f3b5beaad4b908e08db13fabc28e103fa3fa8a1dc46bdd6471e98a'
AND (
token = 'QEs70zL5Onxh0nMuGU7FysP55feRh+6Hdq8H80v2ydI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)