UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nmo/HmbeTYZKSqiuyQ3umcMHfIYsFBHVCewyPVgYIic='
WHERE
key_id = 'ee6e761666fcd6251b46c1a2c8d195b4736b8d6111b8858cb2733522cab05c48'
AND (
token = 'Nmo/HmbeTYZKSqiuyQ3umcMHfIYsFBHVCewyPVgYIic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)