UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tc3w4gPUasKM4JGjhWVameMe1/MkUnIpPQCWYdLfkc8='
WHERE
key_id = 'a4623136b152fc600ccf1a4c60d69bde42154e671949d57ec7a55a0a35a51ba4'
AND (
token = 'Tc3w4gPUasKM4JGjhWVameMe1/MkUnIpPQCWYdLfkc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)