UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6D8X/r+mpbBVrZdm1ouGi/QX3I4Y0CcVadXm17crjfo='
WHERE
key_id = '0b3901081f34e6c6c672ef3fc8ce4d173ef37f409ee03360bb8684bddca2a7de'
AND (
token = '6D8X/r+mpbBVrZdm1ouGi/QX3I4Y0CcVadXm17crjfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)