UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CgtYN8LxOKzguIqbxIMx2+xsq7Zsh32ZGQaSMslTggY='
WHERE
key_id = '4c34b4696bc1f6fb4a82332094d81adf8f36ea3134c5d92aff541b8fb478095c'
AND (
token = 'CgtYN8LxOKzguIqbxIMx2+xsq7Zsh32ZGQaSMslTggY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)