UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pKZ+am8xDXC0LxA6IccniFWu2BoM0L0DLilDVZDsCns='
WHERE
key_id = '33945660539d5c88bb64b0bb0097290149049eabfb23c88afdd574adeaa01cbc'
AND (
token = 'pKZ+am8xDXC0LxA6IccniFWu2BoM0L0DLilDVZDsCns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)