UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QbAWlOgsiAD9ePikyDLn/WGxYqG42B92TvXQ1vgy2gI='
WHERE
key_id = 'c4ef78048a3929a554cf11a65d1730447946e69569196a56f279b22c02179212'
AND (
token = 'QbAWlOgsiAD9ePikyDLn/WGxYqG42B92TvXQ1vgy2gI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)