UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ig/+glYy2TzBAp1LLyC9wRyI2TvM5ES1wiIZTp1BaZ4='
WHERE
key_id = 'd35e279153b083087d7c5e64e941ff30c201cf014098855b08ae94ba1c5f2845'
AND (
token = 'ig/+glYy2TzBAp1LLyC9wRyI2TvM5ES1wiIZTp1BaZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)