UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nFjdCOcDM25sC0lQCUxjdc12iTZKnqwhSC//E/8hB+s='
WHERE
key_id = '13f84a268cd902ba5ab40055b2b2fede981bc97fd4f51e4b57e62e2d2163bbe2'
AND (
token = 'nFjdCOcDM25sC0lQCUxjdc12iTZKnqwhSC//E/8hB+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)