UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v1uydVbCCcYmaD/Bb0A0TyV3rcC/YCWGdAVZXrf8UgI='
WHERE
key_id = '9bb3fce5893b394824a8a0fe66136caa1ff725159f22f2b57d50c815bffa0c6b'
AND (
token = 'v1uydVbCCcYmaD/Bb0A0TyV3rcC/YCWGdAVZXrf8UgI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)