UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y/Lfi5njWU2kO89i1PCk+30Xfz9MyU3c4bNAH3npGak='
WHERE
key_id = 'da9b4398d428f431a85b8376c33dab60045af7512d101d35cd8671b93e5bdc5b'
AND (
token = 'Y/Lfi5njWU2kO89i1PCk+30Xfz9MyU3c4bNAH3npGak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)