UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tpsMkKjUMD4nXml4IljtgQhwUYQislODbnSj2988U3c='
WHERE
key_id = '90b1d1947bc642cc7727d79fb4b3fc7c38ba857f62d86167868e2f0288206f61'
AND (
token = 'tpsMkKjUMD4nXml4IljtgQhwUYQislODbnSj2988U3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)