UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6rtNu7nGT0Dble+i7QEUK/lwy4oLfxOd1LXsUkTabzs='
WHERE
key_id = '00404f6f29a67998a873aa562e72f520dcb2307db2f270baf07cb6c731b4e2cd'
AND (
token = '6rtNu7nGT0Dble+i7QEUK/lwy4oLfxOd1LXsUkTabzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)