UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WFvPuEljx1qUcXct09ba+zuG+xDxqs84SNJfZmuaqbo='
WHERE
key_id = '1e38648d38a8c1d1fcb639707e36d64ac0beeee3d0be40de0d9feca2283eabc3'
AND (
token = 'WFvPuEljx1qUcXct09ba+zuG+xDxqs84SNJfZmuaqbo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)