UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VKL/3vVTRrj4Stju2jHjBnXD4VB40cONN4LNeQcQYJQ='
WHERE
key_id = '81f48dcc17d13b437be4da22262749d0c40f2332d9bf309360604008e2feb148'
AND (
token = 'VKL/3vVTRrj4Stju2jHjBnXD4VB40cONN4LNeQcQYJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)