UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zy6FLmtH7jsT5C5n/aTEe4FlZu68Iw1ZXNm/Gw9CO58='
WHERE
key_id = '45e67acace1eedbd4630ac0be92bc200cff934bd0948e9cab87f8f1db370a71c'
AND (
token = 'Zy6FLmtH7jsT5C5n/aTEe4FlZu68Iw1ZXNm/Gw9CO58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)