UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ksxk/712qLe03UWj6OHMH9LUoiHqGcK+Ve5t/bRQ8+c='
WHERE
key_id = '3368ca253db1247cd02da0d8f78a26f46b1be659b553ea83801b2151a9db8914'
AND (
token = 'ksxk/712qLe03UWj6OHMH9LUoiHqGcK+Ve5t/bRQ8+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)