UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '09hnmXEwtjxJlCjmq0GZDyezPE1lak6oaf5EaynLgaI='
WHERE
key_id = '8d9d4a9762a41ca37675c1b0f4d882fb064d50dcedd1c8591ba41b647ea3f6a6'
AND (
token = '09hnmXEwtjxJlCjmq0GZDyezPE1lak6oaf5EaynLgaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)