UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8YS4/8KsHALFO5eppa4qhFkssrvKWbApg1Jxz0LKAUM='
WHERE
key_id = 'd308c02d5e88aa4f652bcdd30cdf7112c850c1e1ace66e09eadc9482c78b4dbb'
AND (
token = '8YS4/8KsHALFO5eppa4qhFkssrvKWbApg1Jxz0LKAUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)