UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pX5oPFcUKoRTIH5ZqJeD0uN3L2VzPPt2Bf/ofPiYtM4='
WHERE
key_id = '77f3fd48d09069841dccc647e62426cd60d14008eeb85587ae1c5234a3a4cda0'
AND (
token = 'pX5oPFcUKoRTIH5ZqJeD0uN3L2VzPPt2Bf/ofPiYtM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)