UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4b26Ukvh5af1RBC1Ch+bUaSdl/V12qDdrlQhuw9T1sc='
WHERE
key_id = '8949dc87662eab099e1d073755429bbee8a2233a1e9f828a53d69387c77f2ead'
AND (
token = '4b26Ukvh5af1RBC1Ch+bUaSdl/V12qDdrlQhuw9T1sc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)