UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9wOg6t8LeFC70GpK4URmfoy1nHDCHFqHOpwKD0aQjQc='
WHERE
key_id = 'b9af3c7d89f3d057d14b29da2b4fd2d1977fdd4e001fd7e182fa363db07dadc2'
AND (
token = '9wOg6t8LeFC70GpK4URmfoy1nHDCHFqHOpwKD0aQjQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)