UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z3glNSxEBoCA4nOCI+deAIlsAY5GMa1uTuMzut7mQ6U='
WHERE
key_id = 'e6552634c33365b8d659eb36fae153ef9b60e6e4ffda539b88f37e7c569f8a4d'
AND (
token = 'Z3glNSxEBoCA4nOCI+deAIlsAY5GMa1uTuMzut7mQ6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)