UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S/bf3UqaORNW5fCURLAl8W0Rx9wn//rdXuFGsZzI7gc='
WHERE
key_id = '3d2309749a6addeb7677c45377df4317c51d0594cca64a40efb9dab3e731c725'
AND (
token = 'S/bf3UqaORNW5fCURLAl8W0Rx9wn//rdXuFGsZzI7gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)