UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vNBzULcBfit1ufkaglSG8fsJTjN39jJXAfh6fKLTewI='
WHERE
key_id = '5c6412e2d8f5f5b2dd6cd85f706503b864d004aeaef8d6335c747324f2a6345b'
AND (
token = 'vNBzULcBfit1ufkaglSG8fsJTjN39jJXAfh6fKLTewI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)