UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nyHmvOMeHfpBF++hWdt5uxJvwOSAURE0Kbg/Eu3U0i0='
WHERE
key_id = '22ccbabbf1d91430f7a13c4097a593a44ef4fc3db78beed623a04e37b03da389'
AND (
token = 'nyHmvOMeHfpBF++hWdt5uxJvwOSAURE0Kbg/Eu3U0i0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)