UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2vJbxzFwr2R3eU3rrrA4RKhgKzlqePM1FqxeScYemHY='
WHERE
key_id = '8a76e5a186098c4489accbfbc774a716085b0ee0c8bdee643ac1e1e3704f4800'
AND (
token = '2vJbxzFwr2R3eU3rrrA4RKhgKzlqePM1FqxeScYemHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)