UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GhIHDpfvNWCxZXo2vIJVpi3EReUKTRbCM6BKDDQLUKI='
WHERE
key_id = 'ac4c3392eb7f9fd3c7b8c3acf3027f0688998155203cc7d9965048c6ee172131'
AND (
token = 'GhIHDpfvNWCxZXo2vIJVpi3EReUKTRbCM6BKDDQLUKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)