UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rP3PXvWqbuj7ZT/jgqhhMcLAtQcI1nGJGZe/xCfXjdo='
WHERE
key_id = 'f43231ee32726b242fae195c58b3529ba8a9c8e766e189bfc31afe8a1f5f8874'
AND (
token = 'rP3PXvWqbuj7ZT/jgqhhMcLAtQcI1nGJGZe/xCfXjdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)